<script setup lang="ts">
import { onMounted, ref } from 'vue';
var props = defineProps<{
    xml?: string, /** 地址 */
    name?: string
}>();

const froms = {create: "create", local: "local"}
interface Disk {
    path: string
    type: string
    size?: number
    from: string
}

const cdromParse = ()=>{
    /**参数解析*/
    if(props.name != null){
        return props.name
    }else if(props.xml != null){
        const parser = new DOMParser();
        const doc = parser.parseFromString(props.xml, "text/xml");
    }
}

const disk = ref<Disk>({path: "", type: "STAT", from: froms.create})
const ioTypes = ["STAT","SCSI" ,"USB"]
onMounted(()=>{
    cdromParse()
})
</script>

<template>
    <el-select v-model="disk.type" style="width: 15%">
        <template v-for="from in froms">
            <el-option :label="from" :value="from" />
        </template>
    </el-select>

    <el-input v-model="disk.path" style="width: 75%"/>
    <label style="margin: 0px 7px">io类型</label>
    <el-select v-model="disk.type" style="width: 15%">
        <template v-for="arch in ioTypes">
            <el-option :label="arch" :value="arch" />
        </template>
    </el-select>
</template>